package com.app.TCES.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.app.TCES.domain.Department;



@Mapper
public interface A_DeptMapper {
	//查询list<Department>
	@Select("select deptId,deptName from department limit #{tmp},#{limit}")
	public List<Department> selecDept(@Param("tmp")int tmp,@Param("limit")int limit);
	//查询总数
	@Select("select count(*) from department")
	public int selecDepts();
	/*@Delete("delete from department where deptId=#{deptId}")
	public void deleteDept(@Param("deptId")int deptId);*/
	
	@Update("update department set deptName=#{deptName} where deptId=#{deptId}")
	public void updateDept(@Param("deptName")String deptName,@Param("deptId")int deptId);
	
	@Insert("insert into department(deptId,deptName)values(#{deptId},#{deptName})")
	public void insertDept(@Param("deptId")int deptId,@Param("deptName")String deptName);
	
}
